<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Line–sphere intersection</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Line%E2%80%93sphere_intersection"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Line–sphere_intersection rootpage-Line–sphere_intersection skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Line–sphere intersection</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Analytic_geometry" title="Analytic geometry">analytic geometry</a>, a <a href="Line_(mathematics)" class="mw-redirect" title="Line (mathematics)">line</a> and a <a href="Sphere" title="Sphere">sphere</a> can <a href="Intersection" title="Intersection">intersect</a> in three ways:
</p>
<ol><li>No intersection at all</li>
<li>Intersection in exactly one point</li>
<li>Intersection in two points.</li></ol>
<p>Methods for distinguishing these cases, and determining the <a href="Coordinates" class="mw-redirect" title="Coordinates">coordinates</a> for the points in the latter cases, are useful in a number of circumstances. For example, it is a common calculation to perform during <a href="Ray_tracing_(graphics)" title="Ray tracing (graphics)">ray tracing</a>.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Calculation_using_vectors_in_3D">Calculation using vectors in 3D</h2></div>
<p>In <a href="Vector_notation" title="Vector notation">vector notation</a>, the equations are as follows:
</p><p>Equation for a <a href="Sphere" title="Sphere">sphere</a>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \left\Vert \mathbf {x} -\mathbf {c} \right\Vert ^{2}=r^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>=</mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \left\Vert \mathbf {x} -\mathbf {c} \right\Vert ^{2}=r^{2}}</annotation>
</semantics>
</math></span><img src="./7c2b52740611bd628969539b637813a86417a501.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.02ex; height:3.343ex;" alt="{\displaystyle \left\Vert \mathbf {x} -\mathbf {c} \right\Vert ^{2}=r^{2}}" loading="lazy"></span>
<ul><li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {x} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {x} }</annotation>
</semantics>
</math></span><img src="./32adf004df5eb0a8c7fd8c0b6b7405183c5a5ef2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.411ex; height:1.676ex;" alt="{\displaystyle \mathbf {x} }" loading="lazy"></span> : points on the sphere</li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {c} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {c} }</annotation>
</semantics>
</math></span><img src="./8798d172f59e21f2ce193a3118d4063d19353ded.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.188ex; height:1.676ex;" alt="{\displaystyle \mathbf {c} }" loading="lazy"></span> : center point</li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle r}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>r</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle r}</annotation>
</semantics>
</math></span><img src="./0d1ecb613aa2984f0576f70f86650b7c2a132538.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.049ex; height:1.676ex;" alt="{\displaystyle r}" loading="lazy"></span> : radius of the sphere</li></ul></dd></dl>
<p>Equation for a line starting at <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {o} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {o} }</annotation>
</semantics>
</math></span><img src="./6cd153c5c9db162ee93e4d2aabba61d032da3af9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.337ex; height:1.676ex;" alt="{\displaystyle \mathbf {o} }" loading="lazy"></span>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {x} =\mathbf {o} +d\mathbf {u} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>+</mo>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {x} =\mathbf {o} +d\mathbf {u} }</annotation>
</semantics>
</math></span><img src="./f5febe0830c36313b1b93a0cfbb46db746d68b0c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:11.388ex; height:2.343ex;" alt="{\displaystyle \mathbf {x} =\mathbf {o} +d\mathbf {u} }" loading="lazy"></span>
<ul><li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {x} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">x</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {x} }</annotation>
</semantics>
</math></span><img src="./32adf004df5eb0a8c7fd8c0b6b7405183c5a5ef2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.411ex; height:1.676ex;" alt="{\displaystyle \mathbf {x} }" loading="lazy"></span> : points on the line</li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {o} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {o} }</annotation>
</semantics>
</math></span><img src="./6cd153c5c9db162ee93e4d2aabba61d032da3af9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.337ex; height:1.676ex;" alt="{\displaystyle \mathbf {o} }" loading="lazy"></span> : origin of the line</li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>d</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d}</annotation>
</semantics>
</math></span><img src="./e85ff03cbe0c7341af6b982e47e9f90d235c66ab.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.216ex; height:2.176ex;" alt="{\displaystyle d}" loading="lazy"></span> : distance from the origin of the line</li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {u} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {u} }</annotation>
</semantics>
</math></span><img src="./261e20fe101de02a771021d9d4466c0ad3e352d7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.485ex; height:1.676ex;" alt="{\displaystyle \mathbf {u} }" loading="lazy"></span> : direction of line (a non-zero vector)</li></ul></dd></dl>
<p>Searching for points that are on the line and on the sphere means combining the equations and solving for <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>d</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d}</annotation>
</semantics>
</math></span><img src="./e85ff03cbe0c7341af6b982e47e9f90d235c66ab.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.216ex; height:2.176ex;" alt="{\displaystyle d}" loading="lazy"></span>, involving the <a href="Dot_product" title="Dot product">dot product</a> of vectors:
</p>
<dl><dd>Equations combined
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \left\Vert \mathbf {o} +d\mathbf {u} -\mathbf {c} \right\Vert ^{2}=r^{2}\Leftrightarrow (\mathbf {o} +d\mathbf {u} -\mathbf {c} )\cdot (\mathbf {o} +d\mathbf {u} -\mathbf {c} )=r^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>+</mo>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>=</mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">⇔<!-- ⇔ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>+</mo>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>+</mo>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>=</mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \left\Vert \mathbf {o} +d\mathbf {u} -\mathbf {c} \right\Vert ^{2}=r^{2}\Leftrightarrow (\mathbf {o} +d\mathbf {u} -\mathbf {c} )\cdot (\mathbf {o} +d\mathbf {u} -\mathbf {c} )=r^{2}}</annotation>
</semantics>
</math></span><img src="./b8770ffcdc0f940ccb6b4803f7b9467f5996edee.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:55.413ex; height:3.343ex;" alt="{\displaystyle \left\Vert \mathbf {o} +d\mathbf {u} -\mathbf {c} \right\Vert ^{2}=r^{2}\Leftrightarrow (\mathbf {o} +d\mathbf {u} -\mathbf {c} )\cdot (\mathbf {o} +d\mathbf {u} -\mathbf {c} )=r^{2}}" loading="lazy"></span></dd></dl></dd>
<dd>Expanded and rearranged:
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d^{2}(\mathbf {u} \cdot \mathbf {u} )+2d[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]+(\mathbf {o} -\mathbf {c} )\cdot (\mathbf {o} -\mathbf {c} )-r^{2}=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>+</mo>
<mn>2</mn>
<mi>d</mi>
<mo stretchy="false">[</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
<mo>+</mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d^{2}(\mathbf {u} \cdot \mathbf {u} )+2d[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]+(\mathbf {o} -\mathbf {c} )\cdot (\mathbf {o} -\mathbf {c} )-r^{2}=0}</annotation>
</semantics>
</math></span><img src="./63f56f594183c77e637ac6a02272408f56288ca0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:53.655ex; height:3.176ex;" alt="{\displaystyle d^{2}(\mathbf {u} \cdot \mathbf {u} )+2d[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]+(\mathbf {o} -\mathbf {c} )\cdot (\mathbf {o} -\mathbf {c} )-r^{2}=0}" loading="lazy"></span></dd></dl></dd>
<dd>The form of a <a href="Quadratic_formula" title="Quadratic formula">quadratic formula</a> is now observable. (This quadratic equation is an instance of Joachimsthal's equation.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>)
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle ad^{2}+bd+c=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>a</mi>
<msup>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>+</mo>
<mi>b</mi>
<mi>d</mi>
<mo>+</mo>
<mi>c</mi>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle ad^{2}+bd+c=0}</annotation>
</semantics>
</math></span><img src="./a503fe82745981bcaf57b7ba75004899aa14cafb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:16.664ex; height:2.843ex;" alt="{\displaystyle ad^{2}+bd+c=0}" loading="lazy"></span></dd></dl></dd>
<dd>where
<ul><li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a=\mathbf {u} \cdot \mathbf {u} =\left\Vert \mathbf {u} \right\Vert ^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>a</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>=</mo>
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle a=\mathbf {u} \cdot \mathbf {u} =\left\Vert \mathbf {u} \right\Vert ^{2}}</annotation>
</semantics>
</math></span><img src="./2d7c7075b5611c2053f3e79a88c25130be04e488.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.941ex; height:3.343ex;" alt="{\displaystyle a=\mathbf {u} \cdot \mathbf {u} =\left\Vert \mathbf {u} \right\Vert ^{2}}" loading="lazy"></span></li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b=2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>b</mi>
<mo>=</mo>
<mn>2</mn>
<mo stretchy="false">[</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle b=2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]}</annotation>
</semantics>
</math></span><img src="./1d92287b4c21fb5829a729083d709e52a9d5b205.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.891ex; height:2.843ex;" alt="{\displaystyle b=2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]}" loading="lazy"></span></li>
<li><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c=(\mathbf {o} -\mathbf {c} )\cdot (\mathbf {o} -\mathbf {c} )-r^{2}=\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>c</mi>
<mo>=</mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo>−<!-- − --></mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>=</mo>
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle c=(\mathbf {o} -\mathbf {c} )\cdot (\mathbf {o} -\mathbf {c} )-r^{2}=\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2}}</annotation>
</semantics>
</math></span><img src="./a6968796208c141c0cd1b1a4e23bc3e8e7b00896.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:41.862ex; height:3.343ex;" alt="{\displaystyle c=(\mathbf {o} -\mathbf {c} )\cdot (\mathbf {o} -\mathbf {c} )-r^{2}=\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2}}" loading="lazy"></span></li></ul></dd>
<dd>Simplified
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d={\frac {-2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]\pm {\sqrt {(2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )])^{2}-4\left\Vert \mathbf {u} \right\Vert ^{2}(\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2})}}}{2\left\Vert \mathbf {u} \right\Vert ^{2}}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>d</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mo>−<!-- − --></mo>
<mn>2</mn>
<mo stretchy="false">[</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
<mo>±<!-- ± --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mo stretchy="false">(</mo>
<mn>2</mn>
<mo stretchy="false">[</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mn>4</mn>
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">(</mo>
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</msqrt>
</mrow>
</mrow>
<mrow>
<mn>2</mn>
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
</mrow>
</mfrac>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d={\frac {-2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]\pm {\sqrt {(2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )])^{2}-4\left\Vert \mathbf {u} \right\Vert ^{2}(\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2})}}}{2\left\Vert \mathbf {u} \right\Vert ^{2}}}}</annotation>
</semantics>
</math></span><img src="./9d748337376e0a0e4d6e969b1effa417430f5c31.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:64.94ex; height:9.009ex;" alt="{\displaystyle d={\frac {-2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )]\pm {\sqrt {(2[\mathbf {u} \cdot (\mathbf {o} -\mathbf {c} )])^{2}-4\left\Vert \mathbf {u} \right\Vert ^{2}(\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2})}}}{2\left\Vert \mathbf {u} \right\Vert ^{2}}}}" loading="lazy"></span></dd></dl></dd>
<dd>Note that in the specific case where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {u} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {u} }</annotation>
</semantics>
</math></span><img src="./261e20fe101de02a771021d9d4466c0ad3e352d7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.485ex; height:1.676ex;" alt="{\displaystyle \mathbf {u} }" loading="lazy"></span> is a unit vector, and thus <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \left\Vert \mathbf {u} \right\Vert ^{2}=1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>=</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \left\Vert \mathbf {u} \right\Vert ^{2}=1}</annotation>
</semantics>
</math></span><img src="./30bcf9b821d5eec53192b69cd7b1f064164e6e9c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.125ex; height:3.343ex;" alt="{\displaystyle \left\Vert \mathbf {u} \right\Vert ^{2}=1}" loading="lazy"></span>, we can simplify this further to (writing <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\hat {\mathbf {u} }}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo stretchy="false">^<!-- ^ --></mo>
</mover>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\hat {\mathbf {u} }}}</annotation>
</semantics>
</math></span><img src="./b69c2ada3fa0502ac68efb4431455d13ba2d7bd2.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.485ex; height:2.343ex;" alt="{\displaystyle {\hat {\mathbf {u} }}}" loading="lazy"></span> instead of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \mathbf {u} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \mathbf {u} }</annotation>
</semantics>
</math></span><img src="./261e20fe101de02a771021d9d4466c0ad3e352d7.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.485ex; height:1.676ex;" alt="{\displaystyle \mathbf {u} }" loading="lazy"></span> to indicate a unit vector):
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \nabla =[{\hat {\mathbf {u} }}\cdot (\mathbf {o} -\mathbf {c} )]^{2}-(\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2})}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">∇<!-- ∇ --></mi>
<mo>=</mo>
<mo stretchy="false">[</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo stretchy="false">^<!-- ^ --></mo>
</mover>
</mrow>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<msup>
<mo stretchy="false">]</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mo stretchy="false">(</mo>
<msup>
<mrow>
<mo symmetric="true">‖</mo>
<mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
</mrow>
<mo symmetric="true">‖</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<msup>
<mi>r</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo stretchy="false">)</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \nabla =[{\hat {\mathbf {u} }}\cdot (\mathbf {o} -\mathbf {c} )]^{2}-(\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2})}</annotation>
</semantics>
</math></span><img src="./a592c28c9ce24edcc97e73a3965633adcee38025.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:36.058ex; height:3.343ex;" alt="{\displaystyle \nabla =[{\hat {\mathbf {u} }}\cdot (\mathbf {o} -\mathbf {c} )]^{2}-(\left\Vert \mathbf {o} -\mathbf {c} \right\Vert ^{2}-r^{2})}" loading="lazy"></span></dd>
<dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d=-[{\hat {\mathbf {u} }}\cdot (\mathbf {o} -\mathbf {c} )]\pm {\sqrt {\nabla }}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>d</mi>
<mo>=</mo>
<mo>−<!-- − --></mo>
<mo stretchy="false">[</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">u</mi>
</mrow>
<mo stretchy="false">^<!-- ^ --></mo>
</mover>
</mrow>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mo stretchy="false">(</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">o</mi>
</mrow>
<mo>−<!-- − --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="bold">c</mi>
</mrow>
<mo stretchy="false">)</mo>
<mo stretchy="false">]</mo>
<mo>±<!-- ± --></mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mi mathvariant="normal">∇<!-- ∇ --></mi>
</msqrt>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d=-[{\hat {\mathbf {u} }}\cdot (\mathbf {o} -\mathbf {c} )]\pm {\sqrt {\nabla }}}</annotation>
</semantics>
</math></span><img src="./7480cf22d28504097ca4a193c0f7010082b34735.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:24.467ex; height:3.176ex;" alt="{\displaystyle d=-[{\hat {\mathbf {u} }}\cdot (\mathbf {o} -\mathbf {c} )]\pm {\sqrt {\nabla }}}" loading="lazy"></span></dd></dl></dd></dl>
<dl><dd><ul><li>If <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \nabla <0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">∇<!-- ∇ --></mi>
<mo><</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \nabla <0}</annotation>
</semantics>
</math></span><img src="./8e84581e3a737e1530846d1f35250c4bab9b3b79.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.197ex; height:2.176ex;" alt="{\displaystyle \nabla <0}" loading="lazy"></span>, then it is clear that no solutions exist, i.e. the line does not intersect the sphere (case 1).</li>
<li>If <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \nabla =0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">∇<!-- ∇ --></mi>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \nabla =0}</annotation>
</semantics>
</math></span><img src="./b85c5964683af8ce48da098830ce4ac6b346ccf9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.197ex; height:2.176ex;" alt="{\displaystyle \nabla =0}" loading="lazy"></span>, then exactly one solution exists, i.e. the line just touches the sphere in one point (case 2).</li>
<li>If <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \nabla >0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">∇<!-- ∇ --></mi>
<mo>></mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \nabla >0}</annotation>
</semantics>
</math></span><img src="./bf6a796448558165cbd704afeaba4e1286370adf.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.197ex; height:2.176ex;" alt="{\displaystyle \nabla >0}" loading="lazy"></span>, two solutions exist, and thus the line touches the sphere in two points (case 3).</li></ul></dd></dl>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Intersection_(geometry)#A_line_and_a_circle" title="Intersection (geometry)">Intersection (geometry) § A line and a circle</a></li>
<li><a href="Analytic_geometry" title="Analytic geometry">Analytic geometry</a></li>
<li><a href="Line%E2%80%93plane_intersection" title="Line–plane intersection">Line–plane intersection</a></li>
<li><a href="Plane%E2%80%93plane_intersection" title="Plane–plane intersection">Plane–plane intersection</a></li>
<li><a href="Plane%E2%80%93sphere_intersection" class="mw-redirect" title="Plane–sphere intersection">Plane–sphere intersection</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFEberly2006" class="citation book cs1">Eberly, David H. (2006). <i>3D game engine design: a practical approach to real-time computer graphics, 2nd edition</i>. Morgan Kaufmann. p. 698. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-12-229063-1</bdi>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://mathworld.wolfram.com/JoachimsthalsEquation.html">"Joachimsthal's Equation"</a>.</cite></span>
</li>
</ol></div></div></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-05-26" href="https://en.wikipedia.org/wiki/?title=Line%E2%80%93sphere_intersection&oldid=1292428229">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>